package controller.command;

import model.displayer.TextDisplayer;

public class TextContentChangeCmd extends CommandJFxImpl
{
    private TextDisplayer text;
    private String oldText,newText;

    TextContentChangeCmd(TextDisplayer text,String newText)
    {
        super(text);
        this.text = (TextDisplayer) shape;
        this.oldText = text.getContent();
        this.newText = newText;
    }

    @Override
    public void execute()
    {
        text.setContent(newText);
    }

    @Override
    public void cancel()
    {
        text.setContent(oldText);
    }
}
